<?php

namespace App\Containers\AppSection\Data\Data\Repositories;

use App\Containers\AppSection\Data\Models\Passport;
use App\Ship\Parents\Repositories\Repository;

class PassportRepository extends Repository
{
    /**
     * @var array
     */
    protected $fieldSearchable = [
        'id' => '=',
        // ...
    ];

    public function check(int $id): bool
    {
        /** @var Passport $entity */
        $entity = $this->find($id);

        return empty($entity->serial_number) ||
            empty($entity->issue_date) ||
            empty($entity->department_code) ||
            empty($entity->first_photo_id) ||
            empty($entity->second_photo_id) ||
            empty($entity->issued_by);
    }
}
